/*
 * Element.cpp
 *
 *  Created on: 12 mars 2012
 *      Author: lsinapayen
 */

#include "Element.h"

Element::Element(string * nom, string * nomspace = NULL):Item(nom) {

	this->nomspace = *nomspace;
}

Element::~Element() {

}

vector<Attribut*> * Element::getAttributs()
    {
        return &attributs;
    }

/*Data * Element::getData()
    {
        return data;
    }*/

vector<Item*> * Element::getItems()
    {
        return &items;
    }

    void Element::setAttributs(vector<Attribut*> * attributs)
    {
    	vector<Attribut*>::iterator itAtts;
    	itAtts = attributs->begin();
    	while(itAtts!=attributs->end()){
    		this->attributs.push_back((*itAtts));
    		itAtts++;
    	}
    }

/*    void Element::setData(Data * data)
    {
        //this->data->setName(data->getName());
    	this->data = data;
    }*/

void Element::setItems(vector<Item*> * items)
{
	vector<Item*>::iterator itIt;
		itIt = items->begin();
		while(itIt!=items->end()){
			this->items.push_back((*itIt));
			itIt++;
		}
}

string * Element::getNomspace()
{
	return &nomspace;
}

void Element::setNomspace(string * nomspace){
	this->nomspace = *nomspace;
}


int Element::afficher(){
	vector<Item*>::iterator itIts;

	itIts = this->items.begin();

	while(itIts != this->items.end()){
		cout<<" ";
		(*itIts)->afficher();
		itIts++;
	}
	return 0;
}

